/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */

/*
 * AdminForm.java
 *
 * Created on 17-03-2012, 21:46:56
 */
package Management;

import ConnectData.Config;
import ConnectData.getConnections;
import Register.MyMD5;
import UpdateForm.AddCourse;
import UpdateForm.AddPaymentType;
import UpdateForm.AddStudent;
import UpdateForm.AddSubject;
import UpdateForm.AddUser;
import UpdateForm.EditCourse;
import UpdateForm.EditPaymentType;
import UpdateForm.EditSubject;
import UpdateForm.EditUser;
import UploadData.Database;
import com.sun.java.swing.plaf.windows.WindowsLookAndFeel;
import java.awt.HeadlessException;
import java.sql.Connection;
import java.sql.PreparedStatement;
import java.sql.ResultSet;
import java.sql.SQLException;
import java.util.Vector;
import java.util.logging.Level;
import java.util.logging.Logger;
import javax.swing.JOptionPane;
import javax.swing.UIManager;
import javax.swing.UnsupportedLookAndFeelException;
import javax.swing.table.DefaultTableModel;

/**
 *
 */
public class AdminForm extends javax.swing.JFrame {

    private String user;
    private String pw;
    private String oldPassword;
    private String newPassword;
    private String reNewPassword;
    private String Access;
    private Vector vtUsers;
    private Vector vtPayment;
    private Vector vtCourse;
    private Vector vtSubject;
    private Vector vtStudent;

    public void loadUSers() {
        vtUsers = new Database().loadUsers(" order by UserName");
        if (vtUsers.size() != 0) {
            Vector vtCol = new Vector();
            Vector vtDisplay = new Vector();
            for (int i = 0; i < vtUsers.size(); i++) {
                vtCol.add(((Vector) vtUsers.get(i)).get(0).toString());
                String level = ((Vector) vtUsers.get(i)).get(2).toString();
                String Ule;
                if (level.equals("1")) {
                    Ule = "ADMINISTRATOR";
                } else {
                    Ule = "USER";
                }
                vtCol.add(Ule);
                String Status = ((Vector) vtUsers.get(i)).get(3).toString();
                String sta;
                if (!Status.equals("1")) {
                    sta = "Deny";
                } else {
                    sta = "Allow";
                }

                vtCol.add(sta);
                vtCol.add(((Vector) vtUsers.get(i)).get(3).toString());
                vtDisplay.add(vtCol);
                vtCol = new Vector();
            }

            for (int i = 0; i < ((Vector) vtDisplay.get(0)).size(); i++) {
                vtCol.add("Col " + (i + 1));
            }
            vtCol = new Vector();
            vtCol.add("User Name");
            vtCol.add("User Level");
            vtCol.add("Status");

            DefaultTableModel dtm = new DefaultTableModel(vtDisplay, vtCol);
            tbInfoUser.setModel(dtm);
        }
    }

    public void loadPaymentType() {
        vtPayment = new Database().loadPaymentType(" order by TypeName");
        if (vtPayment.size() != 0) {
            Vector vtCol = new Vector();
            Vector vtDisplay = new Vector();
            for (int i = 0; i < vtPayment.size(); i++) {
                vtCol.add(((Vector) vtPayment.get(i)).get(1).toString());
                vtDisplay.add(vtCol);
                vtCol = new Vector();
            }

            for (int i = 0; i < ((Vector) vtDisplay.get(0)).size(); i++) {
                vtCol.add("Col " + (i + 1));
            }
            vtCol = new Vector();
            vtCol.add("Type Name");

            DefaultTableModel dtm = new DefaultTableModel(vtDisplay, vtCol);
            tbInfoPayment.setModel(dtm);
        }
    }

    public void loadCourse() {
        vtCourse = new Database().loadCourse(" order by CourseName");
        if (vtCourse.size() != 0) {
            Vector vtCol = new Vector();
            Vector vtDisplay = new Vector();
            for (int i = 0; i < vtCourse.size(); i++) {
                vtCol.add(((Vector) vtCourse.get(i)).get(1).toString());
                vtCol.add(((Vector) vtCourse.get(i)).get(2).toString());
                vtDisplay.add(vtCol);
                vtCol = new Vector();
            }

            for (int i = 0; i < ((Vector) vtDisplay.get(0)).size(); i++) {
                vtCol.add("Col " + (i + 1));
            }
            vtCol = new Vector();
            vtCol.add("Course Name");
            vtCol.add("Total Fees");

            DefaultTableModel dtm = new DefaultTableModel(vtDisplay, vtCol);
            tbInfoCourse.setModel(dtm);
        }
    }

    public void loadSubject() {
        vtSubject = new Database().loadSubject(" order by SubName");
        if (vtSubject.size() != 0) {
            Vector vtCol = new Vector();
            Vector vtDisplay = new Vector();
            for (int i = 0; i < vtSubject.size(); i++) {
                vtCol.add(((Vector) vtSubject.get(i)).get(1).toString());
                vtDisplay.add(vtCol);
                vtCol = new Vector();
            }

            for (int i = 0; i < ((Vector) vtDisplay.get(0)).size(); i++) {
                vtCol.add("Col " + (i + 1));
            }
            vtCol = new Vector();
            vtCol.add("Subject Name ");

            DefaultTableModel dtm = new DefaultTableModel(vtDisplay, vtCol);
            tbInfoSubject.setModel(dtm);
        } else {
            JOptionPane.showMessageDialog(this, "Not found appropriate data!");
            DefaultTableModel dtm = new DefaultTableModel();
            tbInfoSubject.setModel(dtm);
        }

    }

    public void loadStudents() {
        String strSearch = " where '1'='1'";
        Vector listCourse = cblCourseSearch.SelectedItems();

        int courID = 0;
        int StuID;
        if (listCourse.size() > 0) {
            strSearch += " and StuID in (";
            String temp = "";
            for (int i = 0; i < listCourse.size(); i++) {
                String courName = listCourse.get(i).toString();
                Vector vtCour = new Database().loadCourse(" where CourseName='" + courName + "'");
                if (vtCour.size() > 0) {
                    String CourName;
                    for (int j = 0; j < vtCour.size(); j++) {
                        CourName = ((Vector) vtCour.get(j)).get(1).toString();
                        if (CourName.equals(courName)) {
                            courID = Integer.parseInt(((Vector) vtCour.get(j)).get(0).toString());
                            Vector vtCourReg = new Database().loadCourseRegister(" where CourseID=" + courID);
                            if (vtCourReg.size() > 0) {
                                for (int k = 0; k < vtCourReg.size(); k++) {
                                    StuID = Integer.parseInt(((Vector) vtCourReg.get(k)).get(1).toString());
                                    temp += StuID + ",";
                                }
                            }
                        }
                    }
                }
            }
            if (temp.equalsIgnoreCase("")) {
                temp = "0)";
            } else {
                temp = temp.substring(0, temp.length() - 1) + ")";
            }
            strSearch += temp;
        }

        String str = txtStuNameSearch.getText();
        if (!str.equals("")) {
            strSearch += " and UserName like '%" + str + "%' ";
        }

        str = txtFullNameSearch.getText();
        if (!str.equals("")) {
            strSearch += " and StuName like '%" + str + "%' ";
        }
        str = txtPhone.getText();
        if (!str.equals("")) {
            strSearch += " and StuPhone like '%" + str + "%' ";
        }

        str = txtEmail.getText();
        if (!str.equals("")) {
            strSearch += " and StuEmail like '%" + str + "%' ";
        }

        str = txtAddress.getText();
        if (!str.equals("")) {
            strSearch += " and StuAddress like '%" + str + "%' ";
        }
        strSearch += " order by UserName";
        vtStudent = new Database().loadStudents(strSearch);
        if (vtStudent.size() != 0) {
            Vector vtCol = new Vector();
            Vector vtDisplay = new Vector();
            for (int i = 0; i < vtStudent.size(); i++) {
                vtCol.add(((Vector) vtStudent.get(i)).get(1).toString());
                String Status = ((Vector) vtStudent.get(i)).get(3).toString();

                vtCol.add(((Vector) vtStudent.get(i)).get(4).toString());
                vtCol.add(((Vector) vtStudent.get(i)).get(7).toString());
                vtCol.add(((Vector) vtStudent.get(i)).get(8).toString());
                vtCol.add(((Vector) vtStudent.get(i)).get(9).toString());
                String sta;
                if (!Status.equals("1")) {
                    sta = "Deny";
                } else {
                    sta = "Allow";
                }
                vtCol.add(sta);
                vtDisplay.add(vtCol);
                vtCol = new Vector();
            }

            for (int i = 0; i < ((Vector) vtDisplay.get(0)).size(); i++) {
                vtCol.add("Col " + (i + 1));
            }
            vtCol = new Vector();
            vtCol.add("User Name");
            vtCol.add("Full Name");
            vtCol.add("Phone");
            vtCol.add("Email");
            vtCol.add("Address");
            vtCol.add("Status");
            DefaultTableModel dtm = new DefaultTableModel(vtDisplay, vtCol);
            tbInfo.setModel(dtm);
        } else {
            JOptionPane.showMessageDialog(this, "Not found appropriate data!");
        }
    }

    public void loadCourseSearch() {

        vtCourse = new Database().loadCourse(" order by CourseName");
        if (vtCourse.size() != 0) {
            for (int i = 0; i < vtCourse.size(); i++) {
                String cb = ((Vector) vtCourse.get(i)).get(1).toString();
                cblCourseSearch.add(cb, false);
            }
        }

    }

    /** Creates new form AdminForm */
    public AdminForm(String User, String pass, String Access) {
        try {
            UIManager.setLookAndFeel(new WindowsLookAndFeel());
        } catch (UnsupportedLookAndFeelException ex) {
            Logger.getLogger(AdminForm.class.getName()).log(Level.SEVERE, null, ex);
        }
        initComponents();

        loadUSers();
        loadPaymentType();
        loadCourse();
        loadSubject();
        loadStudents();
        loadCourseSearch();

        this.user = User;
        this.pw = pass;
        this.Access = Access;

    }

    /** This method is called from within the constructor to
     * initialize the form.
     * WARNING: Do NOT modify this code. The content of this method is
     * always regenerated by the Form Editor.
     */
    @SuppressWarnings("unchecked")
    // <editor-fold defaultstate="collapsed" desc="Generated Code">//GEN-BEGIN:initComponents
    private void initComponents() {

        jPanel1 = new javax.swing.JPanel();
        jPanel3 = new javax.swing.JPanel();
        jLabel2 = new javax.swing.JLabel();
        jTabbedPane1 = new javax.swing.JTabbedPane();
        Doctor = new javax.swing.JPanel();
        btnClose = new javax.swing.JButton();
        jScrollPane2 = new javax.swing.JScrollPane();
        tbInfoUser = new javax.swing.JTable();
        btnEdit = new javax.swing.JToggleButton();
        btnAddUser = new javax.swing.JToggleButton();
        btnDeleteUser = new javax.swing.JToggleButton();
        txtValueSearh = new javax.swing.JTextField();
        btnSearchUser = new javax.swing.JButton();
        jLabel1 = new javax.swing.JLabel();
        jPanel4 = new javax.swing.JPanel();
        jPanel9 = new javax.swing.JPanel();
        btnDetail = new javax.swing.JToggleButton();
        btnSearch = new javax.swing.JButton();
        btnClose1 = new javax.swing.JButton();
        lbUserName1 = new javax.swing.JLabel();
        btnInsert = new javax.swing.JToggleButton();
        btnDelete = new javax.swing.JToggleButton();
        jScrollPane1 = new javax.swing.JScrollPane();
        tbInfo = new javax.swing.JTable();
        jPanel10 = new javax.swing.JPanel();
        jPanel12 = new javax.swing.JPanel();
        cblCourseSearch = new creator.components.CheckBoxList();
        jPanel13 = new javax.swing.JPanel();
        jLabel9 = new javax.swing.JLabel();
        jLabel10 = new javax.swing.JLabel();
        txtFullNameSearch = new javax.swing.JTextField();
        txtEmail = new javax.swing.JTextField();
        jLabel7 = new javax.swing.JLabel();
        txtPhone = new javax.swing.JTextField();
        jLabel11 = new javax.swing.JLabel();
        txtAddress = new javax.swing.JTextField();
        jLabel13 = new javax.swing.JLabel();
        txtStuNameSearch = new javax.swing.JTextField();
        jPanel5 = new javax.swing.JPanel();
        jScrollPane3 = new javax.swing.JScrollPane();
        tbInfoSubject = new javax.swing.JTable();
        btnAddSub = new javax.swing.JToggleButton();
        btnEditSub = new javax.swing.JToggleButton();
        btnDeleteSub = new javax.swing.JToggleButton();
        btnClose3 = new javax.swing.JButton();
        btnSearchSub = new javax.swing.JButton();
        txtValueSearchSub = new javax.swing.JTextField();
        jLabel4 = new javax.swing.JLabel();
        jPanel8 = new javax.swing.JPanel();
        jScrollPane5 = new javax.swing.JScrollPane();
        tbInfoCourse = new javax.swing.JTable();
        txtSearchCourseName = new javax.swing.JTextField();
        jLabel16 = new javax.swing.JLabel();
        btnSearchCourse = new javax.swing.JButton();
        btnAddCourse = new javax.swing.JToggleButton();
        btnEditCourse = new javax.swing.JToggleButton();
        btnDeleteCourse = new javax.swing.JToggleButton();
        btnClose5 = new javax.swing.JButton();
        jPanel7 = new javax.swing.JPanel();
        jPanel16 = new javax.swing.JPanel();
        jScrollPane6 = new javax.swing.JScrollPane();
        tbInfoPayment = new javax.swing.JTable();
        btnAddPay = new javax.swing.JToggleButton();
        btnEditPay = new javax.swing.JToggleButton();
        btnDeletePay = new javax.swing.JToggleButton();
        btnClose6 = new javax.swing.JButton();
        jPanel14 = new javax.swing.JPanel();
        txtOldPass = new javax.swing.JPasswordField();
        jLabel17 = new javax.swing.JLabel();
        jLabel18 = new javax.swing.JLabel();
        txtNewPass = new javax.swing.JPasswordField();
        txtRePass = new javax.swing.JPasswordField();
        jLabel19 = new javax.swing.JLabel();
        btnChange1 = new javax.swing.JToggleButton();
        btnClose2 = new javax.swing.JButton();
        lbUserName = new javax.swing.JLabel();

        setDefaultCloseOperation(javax.swing.WindowConstants.EXIT_ON_CLOSE);

        jPanel1.setBackground(new java.awt.Color(153, 255, 204));
        jPanel1.setAutoscrolls(true);

        jLabel2.setIcon(new javax.swing.ImageIcon(getClass().getResource("/icon/90.6peopleonworld.jpg"))); // NOI18N

        javax.swing.GroupLayout jPanel3Layout = new javax.swing.GroupLayout(jPanel3);
        jPanel3.setLayout(jPanel3Layout);
        jPanel3Layout.setHorizontalGroup(
            jPanel3Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(jPanel3Layout.createSequentialGroup()
                .addComponent(jLabel2, javax.swing.GroupLayout.PREFERRED_SIZE, 1087, javax.swing.GroupLayout.PREFERRED_SIZE)
                .addContainerGap(javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE))
        );
        jPanel3Layout.setVerticalGroup(
            jPanel3Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addComponent(jLabel2, javax.swing.GroupLayout.PREFERRED_SIZE, 190, Short.MAX_VALUE)
        );

        jTabbedPane1.setBackground(new java.awt.Color(0, 255, 204));
        jTabbedPane1.setAutoscrolls(true);
        jTabbedPane1.setCursor(new java.awt.Cursor(java.awt.Cursor.DEFAULT_CURSOR));
        jTabbedPane1.addAncestorListener(new javax.swing.event.AncestorListener() {
            public void ancestorMoved(javax.swing.event.AncestorEvent evt) {
            }
            public void ancestorAdded(javax.swing.event.AncestorEvent evt) {
                jTabbedPane1AncestorAdded(evt);
            }
            public void ancestorRemoved(javax.swing.event.AncestorEvent evt) {
            }
        });

        Doctor.setBackground(new java.awt.Color(204, 255, 204));
        Doctor.setForeground(new java.awt.Color(0, 0, 51));
        Doctor.setFont(new java.awt.Font("Tahoma", 1, 11));

        btnClose.setFont(new java.awt.Font("Tahoma", 1, 12));
        btnClose.setForeground(new java.awt.Color(0, 0, 51));
        btnClose.setIcon(new javax.swing.ImageIcon(getClass().getResource("/icon/close1.png"))); // NOI18N
        btnClose.setText("Close");
        btnClose.setBorder(javax.swing.BorderFactory.createEmptyBorder(1, 1, 1, 1));
        btnClose.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                btnCloseActionPerformed(evt);
            }
        });

        jScrollPane2.setAutoscrolls(true);

        tbInfoUser.setForeground(new java.awt.Color(0, 0, 51));
        tbInfoUser.setModel(new javax.swing.table.DefaultTableModel(
            new Object [][] {
                {null, null, null, null},
                {null, null, null, null},
                {null, null, null, null},
                {null, null, null, null}
            },
            new String [] {
                "Title 1", "Title 2", "Title 3", "Title 4"
            }
        ));
        jScrollPane2.setViewportView(tbInfoUser);

        btnEdit.setFont(new java.awt.Font("Tahoma", 1, 12));
        btnEdit.setForeground(new java.awt.Color(0, 0, 51));
        btnEdit.setIcon(new javax.swing.ImageIcon(getClass().getResource("/icon/modify.png"))); // NOI18N
        btnEdit.setText("Edit");
        btnEdit.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                btnEditActionPerformed(evt);
            }
        });

        btnAddUser.setFont(new java.awt.Font("Tahoma", 1, 12));
        btnAddUser.setForeground(new java.awt.Color(0, 0, 51));
        btnAddUser.setIcon(new javax.swing.ImageIcon(getClass().getResource("/icon/add.png"))); // NOI18N
        btnAddUser.setText("Add User");
        btnAddUser.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                btnAddUserActionPerformed(evt);
            }
        });

        btnDeleteUser.setFont(new java.awt.Font("Tahoma", 1, 12));
        btnDeleteUser.setForeground(new java.awt.Color(0, 0, 51));
        btnDeleteUser.setIcon(new javax.swing.ImageIcon(getClass().getResource("/icon/del.png"))); // NOI18N
        btnDeleteUser.setText("Delete");
        btnDeleteUser.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                btnDeleteUserActionPerformed(evt);
            }
        });

        txtValueSearh.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                txtValueSearhActionPerformed(evt);
            }
        });

        btnSearchUser.setFont(new java.awt.Font("Tahoma", 1, 12));
        btnSearchUser.setForeground(new java.awt.Color(0, 0, 51));
        btnSearchUser.setIcon(new javax.swing.ImageIcon(getClass().getResource("/icon/tk.png"))); // NOI18N
        btnSearchUser.setText("Search");
        btnSearchUser.setBorder(javax.swing.BorderFactory.createEmptyBorder(1, 1, 1, 1));
        btnSearchUser.addMouseListener(new java.awt.event.MouseAdapter() {
            public void mouseExited(java.awt.event.MouseEvent evt) {
                btnSearchUserMouseExited(evt);
            }
        });
        btnSearchUser.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                btnSearchUserActionPerformed(evt);
            }
        });

        jLabel1.setFont(new java.awt.Font("Tahoma", 1, 12));
        jLabel1.setText("UserName :");

        javax.swing.GroupLayout DoctorLayout = new javax.swing.GroupLayout(Doctor);
        Doctor.setLayout(DoctorLayout);
        DoctorLayout.setHorizontalGroup(
            DoctorLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(DoctorLayout.createSequentialGroup()
                .addGap(28, 28, 28)
                .addComponent(jScrollPane2, javax.swing.GroupLayout.PREFERRED_SIZE, 624, javax.swing.GroupLayout.PREFERRED_SIZE)
                .addGap(48, 48, 48)
                .addGroup(DoctorLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                    .addGroup(DoctorLayout.createSequentialGroup()
                        .addGroup(DoctorLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                            .addComponent(txtValueSearh, javax.swing.GroupLayout.Alignment.TRAILING, javax.swing.GroupLayout.DEFAULT_SIZE, 188, Short.MAX_VALUE)
                            .addComponent(btnSearchUser, javax.swing.GroupLayout.Alignment.TRAILING, javax.swing.GroupLayout.DEFAULT_SIZE, 188, Short.MAX_VALUE)
                            .addComponent(btnAddUser, javax.swing.GroupLayout.Alignment.TRAILING, javax.swing.GroupLayout.DEFAULT_SIZE, 188, Short.MAX_VALUE)
                            .addComponent(btnEdit, javax.swing.GroupLayout.DEFAULT_SIZE, 188, Short.MAX_VALUE)
                            .addComponent(btnDeleteUser, javax.swing.GroupLayout.DEFAULT_SIZE, 188, Short.MAX_VALUE)
                            .addComponent(btnClose, javax.swing.GroupLayout.PREFERRED_SIZE, 188, javax.swing.GroupLayout.PREFERRED_SIZE))
                        .addGap(116, 116, 116))
                    .addGroup(DoctorLayout.createSequentialGroup()
                        .addComponent(jLabel1, javax.swing.GroupLayout.PREFERRED_SIZE, 178, javax.swing.GroupLayout.PREFERRED_SIZE)
                        .addContainerGap())))
        );
        DoctorLayout.setVerticalGroup(
            DoctorLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(DoctorLayout.createSequentialGroup()
                .addGroup(DoctorLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.TRAILING, false)
                    .addGroup(javax.swing.GroupLayout.Alignment.LEADING, DoctorLayout.createSequentialGroup()
                        .addContainerGap()
                        .addComponent(jScrollPane2, 0, 0, Short.MAX_VALUE))
                    .addGroup(javax.swing.GroupLayout.Alignment.LEADING, DoctorLayout.createSequentialGroup()
                        .addGap(25, 25, 25)
                        .addComponent(jLabel1, javax.swing.GroupLayout.PREFERRED_SIZE, 28, javax.swing.GroupLayout.PREFERRED_SIZE)
                        .addGap(18, 18, 18)
                        .addComponent(txtValueSearh, javax.swing.GroupLayout.PREFERRED_SIZE, 31, javax.swing.GroupLayout.PREFERRED_SIZE)
                        .addGap(18, 18, 18)
                        .addComponent(btnSearchUser, javax.swing.GroupLayout.PREFERRED_SIZE, 39, javax.swing.GroupLayout.PREFERRED_SIZE)
                        .addGap(18, 18, 18)
                        .addComponent(btnAddUser, javax.swing.GroupLayout.PREFERRED_SIZE, 41, javax.swing.GroupLayout.PREFERRED_SIZE)
                        .addGap(18, 18, 18)
                        .addComponent(btnEdit, javax.swing.GroupLayout.PREFERRED_SIZE, 40, javax.swing.GroupLayout.PREFERRED_SIZE)
                        .addGap(18, 18, 18)
                        .addComponent(btnDeleteUser, javax.swing.GroupLayout.PREFERRED_SIZE, 39, javax.swing.GroupLayout.PREFERRED_SIZE)
                        .addGap(18, 18, 18)
                        .addComponent(btnClose, javax.swing.GroupLayout.PREFERRED_SIZE, 39, javax.swing.GroupLayout.PREFERRED_SIZE)))
                .addContainerGap(47, Short.MAX_VALUE))
        );

        jTabbedPane1.addTab("   Users      ", new javax.swing.ImageIcon(getClass().getResource("/icon/User-icon.png")), Doctor); // NOI18N

        jPanel4.setBackground(new java.awt.Color(204, 255, 204));
        jPanel4.setForeground(new java.awt.Color(0, 0, 51));

        jPanel9.setBackground(new java.awt.Color(204, 255, 204));
        jPanel9.setBorder(javax.swing.BorderFactory.createTitledBorder(""));
        jPanel9.setForeground(new java.awt.Color(0, 0, 51));
        jPanel9.setAutoscrolls(true);

        btnDetail.setFont(new java.awt.Font("Tahoma", 1, 12));
        btnDetail.setForeground(new java.awt.Color(0, 0, 51));
        btnDetail.setIcon(new javax.swing.ImageIcon(getClass().getResource("/icon/info.png"))); // NOI18N
        btnDetail.setText("Detail");
        btnDetail.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                btnDetailActionPerformed(evt);
            }
        });

        btnSearch.setFont(new java.awt.Font("Tahoma", 1, 12));
        btnSearch.setForeground(new java.awt.Color(0, 0, 51));
        btnSearch.setIcon(new javax.swing.ImageIcon(getClass().getResource("/icon/tk.png"))); // NOI18N
        btnSearch.setText("Search");
        btnSearch.setBorder(javax.swing.BorderFactory.createEmptyBorder(1, 1, 1, 1));
        btnSearch.addMouseListener(new java.awt.event.MouseAdapter() {
            public void mouseExited(java.awt.event.MouseEvent evt) {
                btnSearchMouseExited(evt);
            }
        });
        btnSearch.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                btnSearchActionPerformed(evt);
            }
        });

        btnClose1.setFont(new java.awt.Font("Tahoma", 1, 12));
        btnClose1.setForeground(new java.awt.Color(0, 0, 51));
        btnClose1.setIcon(new javax.swing.ImageIcon(getClass().getResource("/icon/close1.png"))); // NOI18N
        btnClose1.setText("Close");
        btnClose1.setBorder(javax.swing.BorderFactory.createEmptyBorder(1, 1, 1, 1));
        btnClose1.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                btnClose1ActionPerformed(evt);
            }
        });

        lbUserName1.setFont(new java.awt.Font("Tahoma", 1, 12));
        lbUserName1.setForeground(new java.awt.Color(0, 0, 51));
        lbUserName1.setText("   ");

        btnInsert.setFont(new java.awt.Font("Tahoma", 1, 12));
        btnInsert.setForeground(new java.awt.Color(0, 0, 51));
        btnInsert.setIcon(new javax.swing.ImageIcon(getClass().getResource("/icon/add.png"))); // NOI18N
        btnInsert.setText("Insert");
        btnInsert.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                btnInsertActionPerformed(evt);
            }
        });

        btnDelete.setFont(new java.awt.Font("Tahoma", 1, 12));
        btnDelete.setForeground(new java.awt.Color(0, 0, 51));
        btnDelete.setIcon(new javax.swing.ImageIcon(getClass().getResource("/icon/del.png"))); // NOI18N
        btnDelete.setText("Delete");
        btnDelete.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                btnDeleteActionPerformed(evt);
            }
        });

        javax.swing.GroupLayout jPanel9Layout = new javax.swing.GroupLayout(jPanel9);
        jPanel9.setLayout(jPanel9Layout);
        jPanel9Layout.setHorizontalGroup(
            jPanel9Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(javax.swing.GroupLayout.Alignment.TRAILING, jPanel9Layout.createSequentialGroup()
                .addContainerGap()
                .addComponent(lbUserName1)
                .addGap(803, 803, 803))
            .addGroup(jPanel9Layout.createSequentialGroup()
                .addContainerGap()
                .addComponent(btnInsert)
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
                .addComponent(btnDetail)
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                .addComponent(btnDelete)
                .addGap(9, 9, 9)
                .addComponent(btnSearch, javax.swing.GroupLayout.PREFERRED_SIZE, 92, javax.swing.GroupLayout.PREFERRED_SIZE)
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                .addComponent(btnClose1, javax.swing.GroupLayout.PREFERRED_SIZE, 81, javax.swing.GroupLayout.PREFERRED_SIZE)
                .addContainerGap(318, Short.MAX_VALUE))
        );
        jPanel9Layout.setVerticalGroup(
            jPanel9Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(jPanel9Layout.createSequentialGroup()
                .addContainerGap()
                .addComponent(lbUserName1)
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED, 297, Short.MAX_VALUE)
                .addGroup(jPanel9Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                    .addComponent(btnDetail, javax.swing.GroupLayout.PREFERRED_SIZE, 38, javax.swing.GroupLayout.PREFERRED_SIZE)
                    .addComponent(btnInsert, javax.swing.GroupLayout.PREFERRED_SIZE, 38, javax.swing.GroupLayout.PREFERRED_SIZE)
                    .addComponent(btnClose1, javax.swing.GroupLayout.PREFERRED_SIZE, 39, javax.swing.GroupLayout.PREFERRED_SIZE)
                    .addComponent(btnSearch, javax.swing.GroupLayout.PREFERRED_SIZE, 39, javax.swing.GroupLayout.PREFERRED_SIZE)
                    .addComponent(btnDelete, javax.swing.GroupLayout.PREFERRED_SIZE, 38, javax.swing.GroupLayout.PREFERRED_SIZE))
                .addContainerGap())
        );

        jScrollPane1.setBackground(new java.awt.Color(204, 255, 204));
        jScrollPane1.setAutoscrolls(true);
        jScrollPane1.setDoubleBuffered(true);
        jScrollPane1.addMouseListener(new java.awt.event.MouseAdapter() {
            public void mouseClicked(java.awt.event.MouseEvent evt) {
                jScrollPane1MouseClicked(evt);
            }
        });

        tbInfo.setModel(new javax.swing.table.DefaultTableModel(
            new Object [][] {
                {},
                {},
                {},
                {}
            },
            new String [] {

            }
        ));
        tbInfo.setToolTipText("To see details please click on appropriate row!");
        tbInfo.addMouseListener(new java.awt.event.MouseAdapter() {
            public void mouseClicked(java.awt.event.MouseEvent evt) {
                tbInfoMouseClicked(evt);
            }
        });
        jScrollPane1.setViewportView(tbInfo);

        jPanel10.setBackground(new java.awt.Color(204, 255, 153));
        jPanel10.setBorder(javax.swing.BorderFactory.createTitledBorder(null, "Search", javax.swing.border.TitledBorder.DEFAULT_JUSTIFICATION, javax.swing.border.TitledBorder.DEFAULT_POSITION, new java.awt.Font("Tahoma", 1, 14), new java.awt.Color(255, 102, 0))); // NOI18N
        jPanel10.setForeground(new java.awt.Color(0, 0, 51));
        jPanel10.setAutoscrolls(true);

        jPanel12.setBackground(new java.awt.Color(204, 255, 204));
        jPanel12.setBorder(javax.swing.BorderFactory.createTitledBorder(null, "Course", javax.swing.border.TitledBorder.DEFAULT_JUSTIFICATION, javax.swing.border.TitledBorder.DEFAULT_POSITION, new java.awt.Font("Tahoma", 1, 12), new java.awt.Color(255, 0, 0))); // NOI18N
        jPanel12.setForeground(new java.awt.Color(0, 0, 51));
        jPanel12.setCursor(new java.awt.Cursor(java.awt.Cursor.DEFAULT_CURSOR));

        cblCourseSearch.addMouseListener(new java.awt.event.MouseAdapter() {
            public void mouseClicked(java.awt.event.MouseEvent evt) {
                cblCourseSearchMouseClicked(evt);
            }
        });

        javax.swing.GroupLayout jPanel12Layout = new javax.swing.GroupLayout(jPanel12);
        jPanel12.setLayout(jPanel12Layout);
        jPanel12Layout.setHorizontalGroup(
            jPanel12Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(jPanel12Layout.createSequentialGroup()
                .addGap(33, 33, 33)
                .addComponent(cblCourseSearch, javax.swing.GroupLayout.PREFERRED_SIZE, 185, javax.swing.GroupLayout.PREFERRED_SIZE)
                .addContainerGap(35, Short.MAX_VALUE))
        );
        jPanel12Layout.setVerticalGroup(
            jPanel12Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(jPanel12Layout.createSequentialGroup()
                .addComponent(cblCourseSearch, javax.swing.GroupLayout.DEFAULT_SIZE, 114, Short.MAX_VALUE)
                .addContainerGap())
        );

        jPanel13.setBackground(new java.awt.Color(204, 255, 204));
        jPanel13.setBorder(javax.swing.BorderFactory.createTitledBorder(null, "Private Info", javax.swing.border.TitledBorder.DEFAULT_JUSTIFICATION, javax.swing.border.TitledBorder.DEFAULT_POSITION, new java.awt.Font("Tahoma", 1, 12), new java.awt.Color(255, 0, 0))); // NOI18N
        jPanel13.setForeground(new java.awt.Color(0, 0, 51));

        jLabel9.setFont(new java.awt.Font("Tahoma", 1, 11));
        jLabel9.setForeground(new java.awt.Color(0, 0, 51));
        jLabel9.setText("Full Name :");

        jLabel10.setFont(new java.awt.Font("Tahoma", 1, 11));
        jLabel10.setForeground(new java.awt.Color(0, 0, 51));
        jLabel10.setText("Email : ");

        txtFullNameSearch.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                txtFullNameSearchActionPerformed(evt);
            }
        });

        txtEmail.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                txtEmailActionPerformed(evt);
            }
        });

        jLabel7.setFont(new java.awt.Font("Tahoma", 1, 11));
        jLabel7.setForeground(new java.awt.Color(0, 0, 51));
        jLabel7.setText("Phone :");

        txtPhone.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                txtPhoneActionPerformed(evt);
            }
        });

        jLabel11.setFont(new java.awt.Font("Tahoma", 1, 11));
        jLabel11.setForeground(new java.awt.Color(0, 0, 51));
        jLabel11.setText("Address : ");

        txtAddress.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                txtAddressActionPerformed(evt);
            }
        });

        jLabel13.setFont(new java.awt.Font("Tahoma", 1, 11));
        jLabel13.setForeground(new java.awt.Color(0, 0, 51));
        jLabel13.setText("UserName: ");

        txtStuNameSearch.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                txtStuNameSearchActionPerformed(evt);
            }
        });

        javax.swing.GroupLayout jPanel13Layout = new javax.swing.GroupLayout(jPanel13);
        jPanel13.setLayout(jPanel13Layout);
        jPanel13Layout.setHorizontalGroup(
            jPanel13Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(jPanel13Layout.createSequentialGroup()
                .addGroup(jPanel13Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                    .addComponent(jLabel9)
                    .addComponent(jLabel10)
                    .addComponent(jLabel11)
                    .addComponent(jLabel7)
                    .addComponent(jLabel13))
                .addGap(21, 21, 21)
                .addGroup(jPanel13Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING, false)
                    .addComponent(txtStuNameSearch)
                    .addComponent(txtPhone)
                    .addComponent(txtAddress)
                    .addComponent(txtFullNameSearch)
                    .addComponent(txtEmail, javax.swing.GroupLayout.DEFAULT_SIZE, 158, Short.MAX_VALUE))
                .addContainerGap(javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE))
        );
        jPanel13Layout.setVerticalGroup(
            jPanel13Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(jPanel13Layout.createSequentialGroup()
                .addContainerGap()
                .addGroup(jPanel13Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                    .addComponent(jLabel13)
                    .addComponent(txtStuNameSearch, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
                .addGap(5, 5, 5)
                .addGroup(jPanel13Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                    .addComponent(jLabel9)
                    .addComponent(txtFullNameSearch, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
                .addGroup(jPanel13Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                    .addComponent(jLabel10)
                    .addComponent(txtEmail, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
                .addGap(8, 8, 8)
                .addGroup(jPanel13Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                    .addComponent(jLabel11)
                    .addComponent(txtAddress, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
                .addGap(18, 18, 18)
                .addGroup(jPanel13Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                    .addComponent(jLabel7, javax.swing.GroupLayout.PREFERRED_SIZE, 18, javax.swing.GroupLayout.PREFERRED_SIZE)
                    .addComponent(txtPhone, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
                .addContainerGap(21, Short.MAX_VALUE))
        );

        javax.swing.GroupLayout jPanel10Layout = new javax.swing.GroupLayout(jPanel10);
        jPanel10.setLayout(jPanel10Layout);
        jPanel10Layout.setHorizontalGroup(
            jPanel10Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(javax.swing.GroupLayout.Alignment.TRAILING, jPanel10Layout.createSequentialGroup()
                .addGroup(jPanel10Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.TRAILING)
                    .addComponent(jPanel12, javax.swing.GroupLayout.Alignment.LEADING, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
                    .addComponent(jPanel13, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE))
                .addContainerGap())
        );
        jPanel10Layout.setVerticalGroup(
            jPanel10Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(javax.swing.GroupLayout.Alignment.TRAILING, jPanel10Layout.createSequentialGroup()
                .addComponent(jPanel12, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
                .addComponent(jPanel13, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
        );

        javax.swing.GroupLayout jPanel4Layout = new javax.swing.GroupLayout(jPanel4);
        jPanel4.setLayout(jPanel4Layout);
        jPanel4Layout.setHorizontalGroup(
            jPanel4Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(jPanel4Layout.createSequentialGroup()
                .addContainerGap()
                .addComponent(jScrollPane1, javax.swing.GroupLayout.PREFERRED_SIZE, 635, javax.swing.GroupLayout.PREFERRED_SIZE)
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                .addComponent(jPanel10, javax.swing.GroupLayout.DEFAULT_SIZE, 279, Short.MAX_VALUE)
                .addContainerGap())
            .addGroup(jPanel4Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                .addGroup(jPanel4Layout.createSequentialGroup()
                    .addGap(2, 2, 2)
                    .addComponent(jPanel9, javax.swing.GroupLayout.PREFERRED_SIZE, 645, javax.swing.GroupLayout.PREFERRED_SIZE)
                    .addContainerGap(292, Short.MAX_VALUE)))
        );
        jPanel4Layout.setVerticalGroup(
            jPanel4Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(jPanel4Layout.createSequentialGroup()
                .addGroup(jPanel4Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                    .addComponent(jPanel10, javax.swing.GroupLayout.PREFERRED_SIZE, 389, javax.swing.GroupLayout.PREFERRED_SIZE)
                    .addComponent(jScrollPane1, javax.swing.GroupLayout.PREFERRED_SIZE, 313, javax.swing.GroupLayout.PREFERRED_SIZE))
                .addContainerGap(48, Short.MAX_VALUE))
            .addGroup(jPanel4Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                .addGroup(jPanel4Layout.createSequentialGroup()
                    .addComponent(jPanel9, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                    .addContainerGap(51, Short.MAX_VALUE)))
        );

        jTabbedPane1.addTab("  Student  ", new javax.swing.ImageIcon(getClass().getResource("/icon/LAVC_Portal_Menu_Student.png")), jPanel4); // NOI18N

        jPanel5.setBackground(new java.awt.Color(204, 255, 204));

        tbInfoSubject.setForeground(new java.awt.Color(0, 0, 51));
        tbInfoSubject.setModel(new javax.swing.table.DefaultTableModel(
            new Object [][] {
                {null, null, null, null},
                {null, null, null, null},
                {null, null, null, null},
                {null, null, null, null}
            },
            new String [] {
                "Title 1", "Title 2", "Title 3", "Title 4"
            }
        ));
        jScrollPane3.setViewportView(tbInfoSubject);

        btnAddSub.setFont(new java.awt.Font("Tahoma", 1, 12));
        btnAddSub.setForeground(new java.awt.Color(0, 0, 51));
        btnAddSub.setIcon(new javax.swing.ImageIcon(getClass().getResource("/icon/add.png"))); // NOI18N
        btnAddSub.setText("Add Subject");
        btnAddSub.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                btnAddSubActionPerformed(evt);
            }
        });

        btnEditSub.setFont(new java.awt.Font("Tahoma", 1, 12));
        btnEditSub.setForeground(new java.awt.Color(0, 0, 51));
        btnEditSub.setIcon(new javax.swing.ImageIcon(getClass().getResource("/icon/modify.png"))); // NOI18N
        btnEditSub.setText("Edit");
        btnEditSub.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                btnEditSubActionPerformed(evt);
            }
        });

        btnDeleteSub.setFont(new java.awt.Font("Tahoma", 1, 12));
        btnDeleteSub.setForeground(new java.awt.Color(0, 0, 51));
        btnDeleteSub.setIcon(new javax.swing.ImageIcon(getClass().getResource("/icon/del.png"))); // NOI18N
        btnDeleteSub.setText("Delete");
        btnDeleteSub.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                btnDeleteSubActionPerformed(evt);
            }
        });

        btnClose3.setFont(new java.awt.Font("Tahoma", 1, 12));
        btnClose3.setForeground(new java.awt.Color(0, 0, 51));
        btnClose3.setIcon(new javax.swing.ImageIcon(getClass().getResource("/icon/close1.png"))); // NOI18N
        btnClose3.setText("Close");
        btnClose3.setBorder(javax.swing.BorderFactory.createEmptyBorder(1, 1, 1, 1));
        btnClose3.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                btnClose3ActionPerformed(evt);
            }
        });

        btnSearchSub.setFont(new java.awt.Font("Tahoma", 1, 12));
        btnSearchSub.setForeground(new java.awt.Color(0, 0, 51));
        btnSearchSub.setIcon(new javax.swing.ImageIcon(getClass().getResource("/icon/tk.png"))); // NOI18N
        btnSearchSub.setText("Search");
        btnSearchSub.setBorder(javax.swing.BorderFactory.createEmptyBorder(1, 1, 1, 1));
        btnSearchSub.addMouseListener(new java.awt.event.MouseAdapter() {
            public void mouseExited(java.awt.event.MouseEvent evt) {
                btnSearchSubMouseExited(evt);
            }
        });
        btnSearchSub.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                btnSearchSubActionPerformed(evt);
            }
        });

        txtValueSearchSub.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                txtValueSearchSubActionPerformed(evt);
            }
        });

        jLabel4.setFont(new java.awt.Font("Tahoma", 1, 12));
        jLabel4.setText("Subject Name :");

        javax.swing.GroupLayout jPanel5Layout = new javax.swing.GroupLayout(jPanel5);
        jPanel5.setLayout(jPanel5Layout);
        jPanel5Layout.setHorizontalGroup(
            jPanel5Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(jPanel5Layout.createSequentialGroup()
                .addContainerGap()
                .addComponent(jScrollPane3, javax.swing.GroupLayout.PREFERRED_SIZE, 610, javax.swing.GroupLayout.PREFERRED_SIZE)
                .addGap(45, 45, 45)
                .addGroup(jPanel5Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                    .addComponent(btnClose3, javax.swing.GroupLayout.DEFAULT_SIZE, 137, Short.MAX_VALUE)
                    .addComponent(btnEditSub, javax.swing.GroupLayout.DEFAULT_SIZE, 137, Short.MAX_VALUE)
                    .addComponent(btnAddSub, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
                    .addComponent(jLabel4, javax.swing.GroupLayout.DEFAULT_SIZE, 137, Short.MAX_VALUE)
                    .addComponent(txtValueSearchSub, javax.swing.GroupLayout.DEFAULT_SIZE, 137, Short.MAX_VALUE)
                    .addComponent(btnSearchSub, javax.swing.GroupLayout.DEFAULT_SIZE, 137, Short.MAX_VALUE)
                    .addComponent(btnDeleteSub, javax.swing.GroupLayout.Alignment.TRAILING, javax.swing.GroupLayout.DEFAULT_SIZE, 137, Short.MAX_VALUE))
                .addGap(165, 165, 165))
        );
        jPanel5Layout.setVerticalGroup(
            jPanel5Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(jPanel5Layout.createSequentialGroup()
                .addContainerGap()
                .addGroup(jPanel5Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                    .addComponent(jScrollPane3, javax.swing.GroupLayout.PREFERRED_SIZE, 369, javax.swing.GroupLayout.PREFERRED_SIZE)
                    .addGroup(jPanel5Layout.createSequentialGroup()
                        .addComponent(jLabel4, javax.swing.GroupLayout.PREFERRED_SIZE, 33, javax.swing.GroupLayout.PREFERRED_SIZE)
                        .addGap(18, 18, 18)
                        .addComponent(txtValueSearchSub, javax.swing.GroupLayout.PREFERRED_SIZE, 36, javax.swing.GroupLayout.PREFERRED_SIZE)
                        .addGap(21, 21, 21)
                        .addComponent(btnSearchSub, javax.swing.GroupLayout.PREFERRED_SIZE, 39, javax.swing.GroupLayout.PREFERRED_SIZE)
                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
                        .addComponent(btnAddSub, javax.swing.GroupLayout.PREFERRED_SIZE, 41, javax.swing.GroupLayout.PREFERRED_SIZE)
                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
                        .addComponent(btnEditSub, javax.swing.GroupLayout.PREFERRED_SIZE, 40, javax.swing.GroupLayout.PREFERRED_SIZE)
                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
                        .addComponent(btnDeleteSub, javax.swing.GroupLayout.PREFERRED_SIZE, 39, javax.swing.GroupLayout.PREFERRED_SIZE)
                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
                        .addComponent(btnClose3, javax.swing.GroupLayout.PREFERRED_SIZE, 39, javax.swing.GroupLayout.PREFERRED_SIZE)))
                .addContainerGap(57, Short.MAX_VALUE))
        );

        jTabbedPane1.addTab("  Subject  ", new javax.swing.ImageIcon(getClass().getResource("/icon/student-icon.png")), jPanel5); // NOI18N

        jPanel8.setBackground(new java.awt.Color(204, 255, 204));

        tbInfoCourse.setForeground(new java.awt.Color(0, 0, 51));
        tbInfoCourse.setModel(new javax.swing.table.DefaultTableModel(
            new Object [][] {
                {null, null, null, null},
                {null, null, null, null},
                {null, null, null, null},
                {null, null, null, null}
            },
            new String [] {
                "Title 1", "Title 2", "Title 3", "Title 4"
            }
        ));
        jScrollPane5.setViewportView(tbInfoCourse);

        txtSearchCourseName.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                txtSearchCourseNameActionPerformed(evt);
            }
        });

        jLabel16.setFont(new java.awt.Font("Tahoma", 1, 12));
        jLabel16.setForeground(new java.awt.Color(0, 0, 51));
        jLabel16.setText("Course Name :");

        btnSearchCourse.setFont(new java.awt.Font("Tahoma", 1, 12));
        btnSearchCourse.setForeground(new java.awt.Color(0, 0, 51));
        btnSearchCourse.setIcon(new javax.swing.ImageIcon(getClass().getResource("/icon/tk.png"))); // NOI18N
        btnSearchCourse.setText("Search");
        btnSearchCourse.setBorder(javax.swing.BorderFactory.createEmptyBorder(1, 1, 1, 1));
        btnSearchCourse.addMouseListener(new java.awt.event.MouseAdapter() {
            public void mouseExited(java.awt.event.MouseEvent evt) {
                btnSearchCourseMouseExited(evt);
            }
        });
        btnSearchCourse.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                btnSearchCourseActionPerformed(evt);
            }
        });

        btnAddCourse.setFont(new java.awt.Font("Tahoma", 1, 12));
        btnAddCourse.setForeground(new java.awt.Color(0, 0, 51));
        btnAddCourse.setIcon(new javax.swing.ImageIcon(getClass().getResource("/icon/add.png"))); // NOI18N
        btnAddCourse.setText("Add Course");
        btnAddCourse.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                btnAddCourseActionPerformed(evt);
            }
        });

        btnEditCourse.setFont(new java.awt.Font("Tahoma", 1, 12));
        btnEditCourse.setForeground(new java.awt.Color(0, 0, 51));
        btnEditCourse.setIcon(new javax.swing.ImageIcon(getClass().getResource("/icon/modify.png"))); // NOI18N
        btnEditCourse.setText("Edit");
        btnEditCourse.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                btnEditCourseActionPerformed(evt);
            }
        });

        btnDeleteCourse.setFont(new java.awt.Font("Tahoma", 1, 12));
        btnDeleteCourse.setForeground(new java.awt.Color(0, 0, 51));
        btnDeleteCourse.setIcon(new javax.swing.ImageIcon(getClass().getResource("/icon/del.png"))); // NOI18N
        btnDeleteCourse.setText("Delete");
        btnDeleteCourse.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                btnDeleteCourseActionPerformed(evt);
            }
        });

        btnClose5.setFont(new java.awt.Font("Tahoma", 1, 12));
        btnClose5.setForeground(new java.awt.Color(0, 0, 51));
        btnClose5.setIcon(new javax.swing.ImageIcon(getClass().getResource("/icon/close1.png"))); // NOI18N
        btnClose5.setText("Close");
        btnClose5.setBorder(javax.swing.BorderFactory.createEmptyBorder(1, 1, 1, 1));
        btnClose5.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                btnClose5ActionPerformed(evt);
            }
        });

        javax.swing.GroupLayout jPanel8Layout = new javax.swing.GroupLayout(jPanel8);
        jPanel8.setLayout(jPanel8Layout);
        jPanel8Layout.setHorizontalGroup(
            jPanel8Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(jPanel8Layout.createSequentialGroup()
                .addGap(36, 36, 36)
                .addComponent(jScrollPane5, javax.swing.GroupLayout.PREFERRED_SIZE, 421, javax.swing.GroupLayout.PREFERRED_SIZE)
                .addGap(38, 38, 38)
                .addGroup(jPanel8Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                    .addGroup(jPanel8Layout.createSequentialGroup()
                        .addGroup(jPanel8Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                            .addComponent(btnSearchCourse, javax.swing.GroupLayout.DEFAULT_SIZE, 174, Short.MAX_VALUE)
                            .addComponent(btnClose5, javax.swing.GroupLayout.DEFAULT_SIZE, 174, Short.MAX_VALUE)
                            .addComponent(btnAddCourse, javax.swing.GroupLayout.Alignment.TRAILING, javax.swing.GroupLayout.DEFAULT_SIZE, 174, Short.MAX_VALUE)
                            .addComponent(btnEditCourse, javax.swing.GroupLayout.DEFAULT_SIZE, 174, Short.MAX_VALUE)
                            .addComponent(btnDeleteCourse, javax.swing.GroupLayout.DEFAULT_SIZE, 174, Short.MAX_VALUE)
                            .addComponent(txtSearchCourseName, javax.swing.GroupLayout.Alignment.TRAILING, javax.swing.GroupLayout.DEFAULT_SIZE, 174, Short.MAX_VALUE))
                        .addGap(270, 270, 270))
                    .addGroup(jPanel8Layout.createSequentialGroup()
                        .addComponent(jLabel16)
                        .addContainerGap())))
        );
        jPanel8Layout.setVerticalGroup(
            jPanel8Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(jPanel8Layout.createSequentialGroup()
                .addContainerGap()
                .addGroup(jPanel8Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.TRAILING, false)
                    .addComponent(jScrollPane5, javax.swing.GroupLayout.Alignment.LEADING, 0, 0, Short.MAX_VALUE)
                    .addGroup(javax.swing.GroupLayout.Alignment.LEADING, jPanel8Layout.createSequentialGroup()
                        .addComponent(jLabel16)
                        .addGap(18, 18, 18)
                        .addComponent(txtSearchCourseName, javax.swing.GroupLayout.PREFERRED_SIZE, 36, javax.swing.GroupLayout.PREFERRED_SIZE)
                        .addGap(18, 18, 18)
                        .addComponent(btnSearchCourse, javax.swing.GroupLayout.PREFERRED_SIZE, 42, javax.swing.GroupLayout.PREFERRED_SIZE)
                        .addGap(18, 18, 18)
                        .addComponent(btnAddCourse, javax.swing.GroupLayout.PREFERRED_SIZE, 41, javax.swing.GroupLayout.PREFERRED_SIZE)
                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
                        .addComponent(btnEditCourse, javax.swing.GroupLayout.PREFERRED_SIZE, 40, javax.swing.GroupLayout.PREFERRED_SIZE)
                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
                        .addComponent(btnDeleteCourse, javax.swing.GroupLayout.PREFERRED_SIZE, 39, javax.swing.GroupLayout.PREFERRED_SIZE)
                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
                        .addComponent(btnClose5, javax.swing.GroupLayout.PREFERRED_SIZE, 39, javax.swing.GroupLayout.PREFERRED_SIZE)))
                .addContainerGap())
        );

        jTabbedPane1.addTab("  Course   ", new javax.swing.ImageIcon(getClass().getResource("/icon/Course.jpg")), jPanel8); // NOI18N

        jPanel7.setBackground(new java.awt.Color(204, 255, 204));

        jPanel16.setBackground(new java.awt.Color(204, 255, 204));

        javax.swing.GroupLayout jPanel16Layout = new javax.swing.GroupLayout(jPanel16);
        jPanel16.setLayout(jPanel16Layout);
        jPanel16Layout.setHorizontalGroup(
            jPanel16Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGap(0, 0, Short.MAX_VALUE)
        );
        jPanel16Layout.setVerticalGroup(
            jPanel16Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGap(0, 0, Short.MAX_VALUE)
        );

        tbInfoPayment.setForeground(new java.awt.Color(0, 0, 51));
        tbInfoPayment.setModel(new javax.swing.table.DefaultTableModel(
            new Object [][] {
                {null, null, null, null},
                {null, null, null, null},
                {null, null, null, null},
                {null, null, null, null}
            },
            new String [] {
                "Title 1", "Title 2", "Title 3", "Title 4"
            }
        ));
        jScrollPane6.setViewportView(tbInfoPayment);

        btnAddPay.setFont(new java.awt.Font("Tahoma", 1, 12));
        btnAddPay.setForeground(new java.awt.Color(0, 0, 51));
        btnAddPay.setIcon(new javax.swing.ImageIcon(getClass().getResource("/icon/add.png"))); // NOI18N
        btnAddPay.setText(" Add Payment");
        btnAddPay.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                btnAddPayActionPerformed(evt);
            }
        });

        btnEditPay.setFont(new java.awt.Font("Tahoma", 1, 12));
        btnEditPay.setForeground(new java.awt.Color(0, 0, 51));
        btnEditPay.setIcon(new javax.swing.ImageIcon(getClass().getResource("/icon/modify.png"))); // NOI18N
        btnEditPay.setText("Edit");
        btnEditPay.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                btnEditPayActionPerformed(evt);
            }
        });

        btnDeletePay.setFont(new java.awt.Font("Tahoma", 1, 12));
        btnDeletePay.setForeground(new java.awt.Color(0, 0, 51));
        btnDeletePay.setIcon(new javax.swing.ImageIcon(getClass().getResource("/icon/del.png"))); // NOI18N
        btnDeletePay.setText("Delete");
        btnDeletePay.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                btnDeletePayActionPerformed(evt);
            }
        });

        btnClose6.setFont(new java.awt.Font("Tahoma", 1, 12));
        btnClose6.setForeground(new java.awt.Color(0, 0, 51));
        btnClose6.setIcon(new javax.swing.ImageIcon(getClass().getResource("/icon/close1.png"))); // NOI18N
        btnClose6.setText("Close");
        btnClose6.setBorder(javax.swing.BorderFactory.createEmptyBorder(1, 1, 1, 1));
        btnClose6.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                btnClose6ActionPerformed(evt);
            }
        });

        javax.swing.GroupLayout jPanel7Layout = new javax.swing.GroupLayout(jPanel7);
        jPanel7.setLayout(jPanel7Layout);
        jPanel7Layout.setHorizontalGroup(
            jPanel7Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(jPanel7Layout.createSequentialGroup()
                .addGap(19, 19, 19)
                .addComponent(jScrollPane6, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                .addGroup(jPanel7Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                    .addGroup(jPanel7Layout.createSequentialGroup()
                        .addGap(322, 322, 322)
                        .addComponent(jPanel16, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
                    .addGroup(jPanel7Layout.createSequentialGroup()
                        .addGap(38, 38, 38)
                        .addGroup(jPanel7Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING, false)
                            .addComponent(btnEditPay, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
                            .addComponent(btnAddPay, javax.swing.GroupLayout.DEFAULT_SIZE, 162, Short.MAX_VALUE)
                            .addComponent(btnDeletePay, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
                            .addComponent(btnClose6, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE))))
                .addContainerGap(146, Short.MAX_VALUE))
        );
        jPanel7Layout.setVerticalGroup(
            jPanel7Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(jPanel7Layout.createSequentialGroup()
                .addGroup(jPanel7Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.TRAILING)
                    .addGroup(javax.swing.GroupLayout.Alignment.LEADING, jPanel7Layout.createSequentialGroup()
                        .addGap(58, 58, 58)
                        .addComponent(jPanel16, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
                    .addGroup(javax.swing.GroupLayout.Alignment.LEADING, jPanel7Layout.createSequentialGroup()
                        .addContainerGap()
                        .addGroup(jPanel7Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                            .addComponent(jScrollPane6, javax.swing.GroupLayout.PREFERRED_SIZE, 331, javax.swing.GroupLayout.PREFERRED_SIZE)
                            .addGroup(jPanel7Layout.createSequentialGroup()
                                .addComponent(btnAddPay, javax.swing.GroupLayout.PREFERRED_SIZE, 41, javax.swing.GroupLayout.PREFERRED_SIZE)
                                .addGap(18, 18, 18)
                                .addComponent(btnEditPay, javax.swing.GroupLayout.PREFERRED_SIZE, 40, javax.swing.GroupLayout.PREFERRED_SIZE)
                                .addGap(18, 18, 18)
                                .addComponent(btnDeletePay, javax.swing.GroupLayout.PREFERRED_SIZE, 39, javax.swing.GroupLayout.PREFERRED_SIZE)
                                .addGap(18, 18, 18)
                                .addComponent(btnClose6, javax.swing.GroupLayout.PREFERRED_SIZE, 39, javax.swing.GroupLayout.PREFERRED_SIZE)))))
                .addContainerGap(95, Short.MAX_VALUE))
        );

        jTabbedPane1.addTab("Payment", new javax.swing.ImageIcon(getClass().getResource("/icon/payment.png")), jPanel7); // NOI18N

        jPanel14.setBackground(new java.awt.Color(204, 255, 204));
        jPanel14.setForeground(new java.awt.Color(0, 0, 51));

        txtOldPass.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                txtOldPassActionPerformed(evt);
            }
        });

        jLabel17.setFont(new java.awt.Font("Arial", 1, 12));
        jLabel17.setForeground(new java.awt.Color(0, 0, 51));
        jLabel17.setText("Old PassWord :");

        jLabel18.setFont(new java.awt.Font("Arial", 1, 12));
        jLabel18.setForeground(new java.awt.Color(0, 0, 51));
        jLabel18.setText("New PassWord :");

        txtNewPass.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                txtNewPassActionPerformed(evt);
            }
        });

        txtRePass.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                txtRePassActionPerformed(evt);
            }
        });

        jLabel19.setFont(new java.awt.Font("Arial", 1, 12));
        jLabel19.setForeground(new java.awt.Color(0, 0, 51));
        jLabel19.setText("Re-PassWord :");

        btnChange1.setFont(new java.awt.Font("Arial", 1, 12));
        btnChange1.setForeground(new java.awt.Color(0, 0, 51));
        btnChange1.setIcon(new javax.swing.ImageIcon(getClass().getResource("/icon/save.png"))); // NOI18N
        btnChange1.setText("Save");
        btnChange1.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                btnChange1ActionPerformed(evt);
            }
        });

        btnClose2.setFont(new java.awt.Font("Arial", 1, 12));
        btnClose2.setForeground(new java.awt.Color(0, 0, 51));
        btnClose2.setIcon(new javax.swing.ImageIcon(getClass().getResource("/icon/close1.png"))); // NOI18N
        btnClose2.setText("Close");
        btnClose2.setBorder(javax.swing.BorderFactory.createEmptyBorder(1, 1, 1, 1));
        btnClose2.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                btnClose2ActionPerformed(evt);
            }
        });

        javax.swing.GroupLayout jPanel14Layout = new javax.swing.GroupLayout(jPanel14);
        jPanel14.setLayout(jPanel14Layout);
        jPanel14Layout.setHorizontalGroup(
            jPanel14Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(jPanel14Layout.createSequentialGroup()
                .addGap(288, 288, 288)
                .addGroup(jPanel14Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.TRAILING)
                    .addGroup(jPanel14Layout.createSequentialGroup()
                        .addGroup(jPanel14Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                            .addComponent(jLabel17)
                            .addComponent(jLabel19))
                        .addGap(23, 23, 23))
                    .addGroup(jPanel14Layout.createSequentialGroup()
                        .addComponent(jLabel18)
                        .addGap(18, 18, 18)))
                .addGroup(jPanel14Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                    .addComponent(txtOldPass, javax.swing.GroupLayout.PREFERRED_SIZE, 206, javax.swing.GroupLayout.PREFERRED_SIZE)
                    .addComponent(txtNewPass, javax.swing.GroupLayout.PREFERRED_SIZE, 206, javax.swing.GroupLayout.PREFERRED_SIZE)
                    .addComponent(txtRePass, javax.swing.GroupLayout.PREFERRED_SIZE, 206, javax.swing.GroupLayout.PREFERRED_SIZE)
                    .addGroup(jPanel14Layout.createSequentialGroup()
                        .addComponent(btnChange1, javax.swing.GroupLayout.PREFERRED_SIZE, 96, javax.swing.GroupLayout.PREFERRED_SIZE)
                        .addGap(18, 18, 18)
                        .addComponent(btnClose2, javax.swing.GroupLayout.PREFERRED_SIZE, 81, javax.swing.GroupLayout.PREFERRED_SIZE)))
                .addContainerGap(333, Short.MAX_VALUE))
        );
        jPanel14Layout.setVerticalGroup(
            jPanel14Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(jPanel14Layout.createSequentialGroup()
                .addGap(64, 64, 64)
                .addGroup(jPanel14Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                    .addComponent(jLabel17)
                    .addComponent(txtOldPass, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
                .addGroup(jPanel14Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.TRAILING)
                    .addComponent(txtNewPass, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                    .addComponent(jLabel18))
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
                .addGroup(jPanel14Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                    .addComponent(jLabel19)
                    .addComponent(txtRePass, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
                .addGap(18, 18, 18)
                .addGroup(jPanel14Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                    .addComponent(btnChange1, javax.swing.GroupLayout.PREFERRED_SIZE, 29, javax.swing.GroupLayout.PREFERRED_SIZE)
                    .addComponent(btnClose2, javax.swing.GroupLayout.PREFERRED_SIZE, 31, javax.swing.GroupLayout.PREFERRED_SIZE))
                .addContainerGap(242, Short.MAX_VALUE))
        );

        jTabbedPane1.addTab("Change Password", new javax.swing.ImageIcon(getClass().getResource("/icon/pass.png")), jPanel14); // NOI18N

        lbUserName.setFont(new java.awt.Font("Tahoma", 1, 12));
        lbUserName.setForeground(new java.awt.Color(0, 0, 51));
        lbUserName.setText("   ");

        javax.swing.GroupLayout jPanel1Layout = new javax.swing.GroupLayout(jPanel1);
        jPanel1.setLayout(jPanel1Layout);
        jPanel1Layout.setHorizontalGroup(
            jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addComponent(jPanel3, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
            .addGroup(jPanel1Layout.createSequentialGroup()
                .addGap(444, 444, 444)
                .addComponent(lbUserName)
                .addContainerGap(641, Short.MAX_VALUE))
            .addGroup(jPanel1Layout.createSequentialGroup()
                .addComponent(jTabbedPane1, javax.swing.GroupLayout.PREFERRED_SIZE, 944, javax.swing.GroupLayout.PREFERRED_SIZE)
                .addContainerGap())
        );
        jPanel1Layout.setVerticalGroup(
            jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(jPanel1Layout.createSequentialGroup()
                .addComponent(jPanel3, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                .addGap(4, 4, 4)
                .addComponent(lbUserName)
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
                .addComponent(jTabbedPane1, javax.swing.GroupLayout.PREFERRED_SIZE, 490, javax.swing.GroupLayout.PREFERRED_SIZE))
        );

        javax.swing.GroupLayout layout = new javax.swing.GroupLayout(getContentPane());
        getContentPane().setLayout(layout);
        layout.setHorizontalGroup(
            layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addComponent(jPanel1, javax.swing.GroupLayout.PREFERRED_SIZE, 945, javax.swing.GroupLayout.PREFERRED_SIZE)
        );
        layout.setVerticalGroup(
            layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addComponent(jPanel1, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
        );

        pack();
    }// </editor-fold>//GEN-END:initComponents

    private void btnCloseActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_btnCloseActionPerformed
        // TODO add your handling code here:
        int i = JOptionPane.showConfirmDialog(this, "Are you sure you want to exit! ", "Exit", 2);
        if (i == 0) {
            this.dispose();
        }
}//GEN-LAST:event_btnCloseActionPerformed

    private void btnEditActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_btnEditActionPerformed
        // TODO add your handling code here:

        int rscurrent = tbInfoUser.getSelectedRow();
        if (rscurrent >= 0) {
            Vector vtU = (Vector) vtUsers.get(rscurrent);
            String UN = vtU.get(0).toString();
            String PWD = vtU.get(1).toString();
            String level = vtU.get(2).toString();
            String sta = vtU.get(3).toString();
            new EditUser(this, true, UN, PWD, level, sta);
        } else {
            JOptionPane.showMessageDialog(this, "Please Select row do you want Edit!");
        }

}//GEN-LAST:event_btnEditActionPerformed

    private void btnAddUserActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_btnAddUserActionPerformed
        // TODO add your handling code here:
        new AddUser(this, true);
}//GEN-LAST:event_btnAddUserActionPerformed

    private void btnDeleteUserActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_btnDeleteUserActionPerformed
        // TODO add your handling code here:

        int rscurrent = tbInfoUser.getSelectedRow();

        if (rscurrent >= 0) {
            if (JOptionPane.showConfirmDialog(this, "Are you sure you want to Delete this User?\nAll of this User Data will be deleted!") == 0) {
                Vector vtDoc = (Vector) vtUsers.get(rscurrent);
                String UserName = vtDoc.get(0).toString();
                int level = Integer.parseInt(vtDoc.get(2).toString());
                if (level == 1) {
                    JOptionPane.showMessageDialog(this, "can't delete user this , here is administrator!!");
                } else {
                    String strDel = "delete Users where UserName=?";
                    Connection cn = new Config().cn;
                    PreparedStatement pst = null;
                    try {
                        pst = cn.prepareCall(strDel);
                        pst.setString(1, UserName);
                        int kq = pst.executeUpdate();
                        if (kq > 0) {
                            JOptionPane.showMessageDialog(this, "Delete successfully!");
                        }
                    } catch (SQLException ex) {
                        ex.printStackTrace();
                        JOptionPane.showConfirmDialog(this, "you can not delete User this");
                    } finally {
                        try {
                            getConnections.closeObject(pst);
                        } catch (Exception ex) {
                            ex.printStackTrace();
                        }
                    }
                }
            }
        } else {
            JOptionPane.showMessageDialog(this, "Please Select row do you want Delete!");
        }
        loadUSers();

}//GEN-LAST:event_btnDeleteUserActionPerformed

    private void txtValueSearhActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_txtValueSearhActionPerformed
        // TODO add your handling code here:
        btnSearchUserActionPerformed(evt);
}//GEN-LAST:event_txtValueSearhActionPerformed

    private void btnSearchUserMouseExited(java.awt.event.MouseEvent evt) {//GEN-FIRST:event_btnSearchUserMouseExited
        // TODO add your handling code here:
}//GEN-LAST:event_btnSearchUserMouseExited

    private void btnSearchUserActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_btnSearchUserActionPerformed
        // TODO add your handling code here:
        String SearchUser = null;
        SearchUser = txtValueSearh.getText().trim();
        Vector vtRs = new Database().loadUsers(" where UserName like '%" + SearchUser + "%' order by UserName");
        if (vtRs.size() != 0) {
            Vector vtCol = new Vector();
            Vector vtDisplay = new Vector();
            for (int i = 0; i < vtRs.size(); i++) {
                vtCol.add(((Vector) vtRs.get(i)).get(0).toString());
                int level = Integer.parseInt(((Vector) vtRs.get(i)).get(2).toString());
                String Ule;
                if (level == 1) {
                    Ule = "ADMINISTRATOR";
                } else {
                    Ule = "USER";
                }
                vtCol.add(Ule);
                String Status = ((Vector) vtRs.get(i)).get(3).toString();
                String sta;
                if (!Status.equals("1")) {
                    sta = "Deny";
                } else {
                    sta = "Allow";
                }
                vtCol.add(sta);
                vtDisplay.add(vtCol);
                vtCol = new Vector();
            }

            for (int i = 0; i < ((Vector) vtDisplay.get(0)).size(); i++) {
                vtCol.add("Col " + (i + 1));
            }
            vtCol = new Vector();
            vtCol.add("User Name");
            vtCol.add("User Level");
            vtCol.add("Status");


            DefaultTableModel dtm = new DefaultTableModel(vtDisplay, vtCol);
            tbInfoUser.setModel(dtm);
        } else {
            JOptionPane.showMessageDialog(this, "Not found appropriate data!");
        }

}//GEN-LAST:event_btnSearchUserActionPerformed

    private void btnDetailActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_btnDetailActionPerformed
        // TODO add your handling code here:
        int rscurrent = tbInfo.getSelectedRow();
        if (rscurrent >= 0) {
            Vector vtDetail = (Vector) vtStudent.get(rscurrent);
            new StudentDetail(this, Integer.parseInt(vtDetail.get(0).toString()), rscurrent, Access, vtDetail.get(1).toString(), vtDetail.get(2).toString());
        } else {
            JOptionPane.showMessageDialog(this, "Please Select Student do you want Watch Detail!");
        }

}//GEN-LAST:event_btnDetailActionPerformed

    private void btnSearchMouseExited(java.awt.event.MouseEvent evt) {//GEN-FIRST:event_btnSearchMouseExited
        // TODO add your handling code here:
}//GEN-LAST:event_btnSearchMouseExited

    private void btnSearchActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_btnSearchActionPerformed
        // TODO add your handling code here:
        //Difine search string
        loadStudents();
}//GEN-LAST:event_btnSearchActionPerformed

    private void btnClose1ActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_btnClose1ActionPerformed
        // TODO add your handling code here:
        int i = JOptionPane.showConfirmDialog(this, "Are you sure you want to exit! ", "Exit", 2);
        if (i == 0) {
            this.dispose();
        }
}//GEN-LAST:event_btnClose1ActionPerformed

    private void btnInsertActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_btnInsertActionPerformed
        // TODO add your handling code here:
        new AddStudent(this, true);
}//GEN-LAST:event_btnInsertActionPerformed

    private void btnDeleteActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_btnDeleteActionPerformed
        // TODO add your handling code here:
        int rscurrent = tbInfo.getSelectedRow();

        if (rscurrent >= 0) {
            if (JOptionPane.showConfirmDialog(this, "Are you sure you want to Delete this Student?\nAll of this Student's Data will be deleted!") == 0) {
                Vector vtDetail = (Vector) vtStudent.get(rscurrent);
                int StuID = Integer.parseInt(vtDetail.get(0).toString());
                String strDel = "delete CourseRegister where StuID=?";
                Connection cn = new Config().cn;
                PreparedStatement pst = null;
                try {
                    pst = cn.prepareCall(strDel);
                    pst.setInt(1, StuID);
                    int kq = pst.executeUpdate();
                } catch (SQLException ex) {
                    ex.printStackTrace();
                } finally {
                    try {
                        getConnections.closeObject(pst);
                    } catch (Exception ex) {
                        ex.printStackTrace();
                    }
                }

                strDel = "delete Students where StuID=?";
                pst = null;
                try {
                    pst = cn.prepareCall(strDel);
                    pst.setInt(1, StuID);
                    int kq = pst.executeUpdate();
                    if (kq > 0) {
                        JOptionPane.showMessageDialog(this, "Delete Successfully!");
                        loadStudents();
                    } else {
                        JOptionPane.showMessageDialog(this, "!");
                    }
                } catch (SQLException ex) {
                    JOptionPane.showConfirmDialog(this, "you can not delete Subject this");
                    ex.printStackTrace();
                } finally {
                    try {
                        getConnections.closeObject(pst);
                        getConnections.closeObject(cn);
                    } catch (Exception ex) {
                        ex.printStackTrace();
                    }
                }
                btnSearchActionPerformed(evt);
            }
        } else {
            JOptionPane.showMessageDialog(this, "Please Select row do you want to Delete!");
        }
}//GEN-LAST:event_btnDeleteActionPerformed

    private void tbInfoMouseClicked(java.awt.event.MouseEvent evt) {//GEN-FIRST:event_tbInfoMouseClicked
        // TODO add your handling code here:
}//GEN-LAST:event_tbInfoMouseClicked

    private void jScrollPane1MouseClicked(java.awt.event.MouseEvent evt) {//GEN-FIRST:event_jScrollPane1MouseClicked
        // TODO add your handling code here:
}//GEN-LAST:event_jScrollPane1MouseClicked

    private void cblCourseSearchMouseClicked(java.awt.event.MouseEvent evt) {//GEN-FIRST:event_cblCourseSearchMouseClicked
        // TODO add your handling code here:
}//GEN-LAST:event_cblCourseSearchMouseClicked

    private void txtFullNameSearchActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_txtFullNameSearchActionPerformed
        // TODO add your handling code here:
        btnSearchActionPerformed(evt);
}//GEN-LAST:event_txtFullNameSearchActionPerformed

    private void txtEmailActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_txtEmailActionPerformed
        // TODO add your handling code here:
        btnSearchActionPerformed(evt);
}//GEN-LAST:event_txtEmailActionPerformed

    private void txtPhoneActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_txtPhoneActionPerformed
        // TODO add your handling code here:
        btnSearchActionPerformed(evt);
}//GEN-LAST:event_txtPhoneActionPerformed

    private void btnAddSubActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_btnAddSubActionPerformed
        // TODO add your handling code here:
        new AddSubject(this, true);
}//GEN-LAST:event_btnAddSubActionPerformed

    private void btnEditSubActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_btnEditSubActionPerformed
        int rscurrent = tbInfoSubject.getSelectedRow();
        if (rscurrent >= 0) {
            // Vector vtS = (Vector) vtSubject.get(rscurrent);
            int subID = Integer.parseInt(((Vector) vtSubject.get(rscurrent)).get(0).toString());
            String subName = ((Vector) vtSubject.get(rscurrent)).get(1).toString();
            new EditSubject(this, true, subName, subID);
        } else {
            JOptionPane.showMessageDialog(this, "Please Select row do you want Edit!");
        }

}//GEN-LAST:event_btnEditSubActionPerformed

    private void btnDeleteSubActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_btnDeleteSubActionPerformed
        // TODO add your handling code here:
        int rscurrent = tbInfoSubject.getSelectedRow();
        if (rscurrent >= 0) {
            if (JOptionPane.showConfirmDialog(this, "Are you sure you want to Delete this Subject?\nAll of this Subject Data will be deleted!") == 0) {
                String strDel = "delete Subject where SubID=?";
                Connection cn = new Config().cn;
                PreparedStatement pst = null;
                try {
                    pst = cn.prepareCall(strDel);
                    pst.setString(1, ((Vector) vtSubject.get(rscurrent)).get(0).toString());
                    int kq = pst.executeUpdate();
                    if (kq != -1) {
                        JOptionPane.showMessageDialog(this, "Delete successful!");
                        loadSubject();
                    }
                } catch (SQLException ex) {
                    ex.printStackTrace();
                    JOptionPane.showConfirmDialog(this, "you can not delete Subject this");
                } finally {
                    try {
                        getConnections.closeObject(pst);
                    } catch (Exception ex) {
                        ex.printStackTrace();
                    }
                }
            }
        } else {
            JOptionPane.showMessageDialog(this, "Please Select row do you want Delete!");
        }

}//GEN-LAST:event_btnDeleteSubActionPerformed

    private void btnClose3ActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_btnClose3ActionPerformed
        // TODO add your handling code here:
        int i = JOptionPane.showConfirmDialog(this, "Are you sure you want to exit! ", "Exit", 2);
        if (i == 0) {
            this.dispose();
        }
}//GEN-LAST:event_btnClose3ActionPerformed

    private void btnSearchSubMouseExited(java.awt.event.MouseEvent evt) {//GEN-FIRST:event_btnSearchSubMouseExited
        // TODO add your handling code here:
}//GEN-LAST:event_btnSearchSubMouseExited

    private void btnSearchSubActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_btnSearchSubActionPerformed
        // TODO add your handling code here:

        vtSubject = new Database().loadSubject(" where SubName like '%" + txtValueSearchSub.getText().trim() + "%' order by SubName");
        if (vtSubject.size() != 0) {
            Vector vtCol = new Vector();
            Vector vtDisplay = new Vector();
            for (int i = 0; i < vtSubject.size(); i++) {
                vtCol.add(((Vector) vtSubject.get(i)).get(1).toString());
                vtDisplay.add(vtCol);
                vtCol = new Vector();
            }

            for (int i = 0; i < ((Vector) vtDisplay.get(0)).size(); i++) {
                vtCol.add("Col " + (i + 1));
            }
            vtCol = new Vector();
            vtCol.add("Subject Name ");

            DefaultTableModel dtm = new DefaultTableModel(vtDisplay, vtCol);
            tbInfoSubject.setModel(dtm);
        } else {
            JOptionPane.showMessageDialog(this, "Not found appropriate data!");
            DefaultTableModel dtm = new DefaultTableModel();
            tbInfoSubject.setModel(dtm);
        }

}//GEN-LAST:event_btnSearchSubActionPerformed

    private void txtValueSearchSubActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_txtValueSearchSubActionPerformed
        // TODO add your handling code here:
        btnSearchSubActionPerformed(evt);
}//GEN-LAST:event_txtValueSearchSubActionPerformed

    private void txtSearchCourseNameActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_txtSearchCourseNameActionPerformed
        // TODO add your handling code here:
        btnSearchCourseActionPerformed(evt);
}//GEN-LAST:event_txtSearchCourseNameActionPerformed

    private void btnSearchCourseMouseExited(java.awt.event.MouseEvent evt) {//GEN-FIRST:event_btnSearchCourseMouseExited
        // TODO add your handling code here:
}//GEN-LAST:event_btnSearchCourseMouseExited

    private void btnSearchCourseActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_btnSearchCourseActionPerformed
        // TODO add your handling code here:
        String strSearch = " where CourseName like '%" + txtSearchCourseName.getText() + "%' order by CourseName";
        Vector vtRs = new Database().loadCourse(strSearch);
        if (vtRs.size() != 0) {
            Vector vtCol = new Vector();
            Vector vtDisplay = new Vector();
            for (int i = 0; i < vtRs.size(); i++) {

                vtCol.add(((Vector) vtRs.get(i)).get(1).toString());
                vtCol.add(((Vector) vtRs.get(i)).get(2).toString());
                vtDisplay.add(vtCol);
                vtCol = new Vector();
            }

            for (int i = 0; i < ((Vector) vtDisplay.get(0)).size(); i++) {
                vtCol.add("Col " + (i + 1));
            }
            vtCol = new Vector();
            vtCol.add("Course Name");
            vtCol.add("Total Fees");
            DefaultTableModel dtm = new DefaultTableModel(vtDisplay, vtCol);
            tbInfoCourse.setModel(dtm);
        } else {
            JOptionPane.showMessageDialog(this, "Not found appropriate data!");
        }

}//GEN-LAST:event_btnSearchCourseActionPerformed

    private void btnAddCourseActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_btnAddCourseActionPerformed
        // TODO add your handling code here:
        new AddCourse(this, true);
}//GEN-LAST:event_btnAddCourseActionPerformed

    private void btnEditCourseActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_btnEditCourseActionPerformed
        // TODO add your handling code here:

        int rscurrent = tbInfoCourse.getSelectedRow();
        if (rscurrent >= 0) {
            Vector vtH = (Vector) vtCourse.get(rscurrent);
            int CourID = Integer.parseInt(vtH.get(0).toString());
            String CourName = vtH.get(1).toString();
            String totalFees = vtH.get(2).toString();
            new EditCourse(this, true, CourID, CourName, totalFees);
        } else {
            JOptionPane.showMessageDialog(this, "Please Select row do you want Edit!");
        }

}//GEN-LAST:event_btnEditCourseActionPerformed

    private void btnDeleteCourseActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_btnDeleteCourseActionPerformed
        // TODO add your handling code here:

        int rscurrent = tbInfoCourse.getSelectedRow();

        if (rscurrent >= 0) {
            if (JOptionPane.showConfirmDialog(this, "Are you sure you want to Delete this Course?\nAll of this Course Data will be deleted!") == 0) {
                String strDel = "delete Course where CourseID=?";
                Connection cn = new Config().cn;
                PreparedStatement pst = null;
                try {
                    pst = cn.prepareCall(strDel);
                    pst.setString(1, ((Vector) vtCourse.get(rscurrent)).get(0).toString());
                    int kq = pst.executeUpdate();
                    if (kq != -1) {
                        JOptionPane.showMessageDialog(this, "Delete successful!");
                        loadCourse();
                    }
                } catch (SQLException ex) {
                    JOptionPane.showConfirmDialog(this, "you can not delete Course this");
                    ex.printStackTrace();

                } finally {
                    try {
                        getConnections.closeObject(pst);
                    } catch (Exception ex) {
                        ex.printStackTrace();
                    }
                }
            }
        } else {
            JOptionPane.showMessageDialog(this, "Please Select row do you want Delete!");
        }

}//GEN-LAST:event_btnDeleteCourseActionPerformed

    private void btnClose5ActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_btnClose5ActionPerformed
        // TODO add your handling code here:
        int i = JOptionPane.showConfirmDialog(this, "Are you sure you want to exit! ", "Exit", 2);
        if (i == 0) {
            this.dispose();
        }
}//GEN-LAST:event_btnClose5ActionPerformed

    private void btnAddPayActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_btnAddPayActionPerformed
        // TODO add your handling code here:
        new AddPaymentType(this, true);
}//GEN-LAST:event_btnAddPayActionPerformed

    private void btnEditPayActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_btnEditPayActionPerformed
        // TODO add your handling code here:

        int rscurrent = tbInfoPayment.getSelectedRow();
        if (rscurrent >= 0) {
            Vector vtL = (Vector) vtPayment.get(rscurrent);
            int payID = Integer.parseInt(vtL.get(0).toString());
            String payName = vtL.get(1).toString();
            new EditPaymentType(this, true, payName, payID);
        } else {
            JOptionPane.showMessageDialog(this, "Please Select row do you want Edit!");
        }

}//GEN-LAST:event_btnEditPayActionPerformed

    private void btnDeletePayActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_btnDeletePayActionPerformed
        // TODO add your handling code here:

        int rscurrent = tbInfoPayment.getSelectedRow();
        if (rscurrent >= 0) {
            if (JOptionPane.showConfirmDialog(this, "Are you sure you want to Delete this Payment Type?") == 0) {
                String strDel = "delete PaymentType where PayTypeID=?";
                Connection cn = new Config().cn;
                PreparedStatement pst = null;

                vtPayment = new Database().loadPaymentType(" order by TypeName");
                try {
                    pst = cn.prepareCall(strDel);
                    pst.setString(1, ((Vector) vtPayment.get(rscurrent)).get(0).toString());
                    int kq = pst.executeUpdate();
                    if (kq != -1) {
                        JOptionPane.showMessageDialog(this, "Delete successful!");
                        loadPaymentType();
                    }
                } catch (SQLException ex) {
                    JOptionPane.showConfirmDialog(this, "you can not delete Payment Type this");
                    ex.printStackTrace();

                } finally {
                    try {
                        getConnections.closeObject(pst);
                    } catch (Exception ex) {
                        ex.printStackTrace();
                    }
                }
            }
        } else {
            JOptionPane.showMessageDialog(this, "Please Select row do you want Delete!");
        }

}//GEN-LAST:event_btnDeletePayActionPerformed

    private void btnClose6ActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_btnClose6ActionPerformed
        // TODO add your handling code here:
        int i = JOptionPane.showConfirmDialog(this, "Are you sure you want to exit! ", "Exit", 2);
        if (i == 0) {
            this.dispose();
        }
}//GEN-LAST:event_btnClose6ActionPerformed

    private void btnChange1ActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_btnChange1ActionPerformed
        // TODO add your handling code here:
        if (validateInformation()) {
            Connection cn = null;
            PreparedStatement pst = null;
            ResultSet rs = null;
            try {

                cn = new Config().cn;
                pst = cn.prepareStatement("select * from Users where UserName=? order by UserLevel");
                pst.setString(1, user);
                rs = pst.executeQuery();
                while (rs.next()) {
                    String pwmd = MyMD5.getMD5String(txtOldPass.getText());
                    if (!rs.getString("UserPassword").equals(pwmd)) {
                        JOptionPane.showMessageDialog(this, "Your old password do not correct");
                        txtOldPass.setText("");
                        txtOldPass.requestFocus();
                    } else {
                        cn = new Config().cn;
                        String strUpdate = "update Users set UserPassword=? where UserName=?";
                        pst = cn.prepareStatement(strUpdate);
                        pst.setString(1, MyMD5.getMD5String(txtNewPass.getText().trim()));
                        pst.setString(2, user);
                        pst.executeUpdate();
                        JOptionPane.showMessageDialog(this, "Change Password Successfully");
                        txtOldPass.setText("");
                        txtNewPass.setText("");
                        txtRePass.setText("");
                    }
                }

            } catch (SQLException se) {
            } catch (HeadlessException he) {
            } catch (Exception e) {
            } finally {
                getConnections.closeObject(rs);
                getConnections.closeObject(pst);
                getConnections.closeObject(cn);
            }
        }

}//GEN-LAST:event_btnChange1ActionPerformed

    private void btnClose2ActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_btnClose2ActionPerformed
        // TODO add your handling code here:
        int i = JOptionPane.showConfirmDialog(this, "Are you sure you want to exit! ", "Exit", 2);
        if (i == 0) {
            this.dispose();
        }
}//GEN-LAST:event_btnClose2ActionPerformed

    private void jTabbedPane1AncestorAdded(javax.swing.event.AncestorEvent evt) {//GEN-FIRST:event_jTabbedPane1AncestorAdded
        // TODO add your handling code here:
}//GEN-LAST:event_jTabbedPane1AncestorAdded

    private void txtAddressActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_txtAddressActionPerformed
        // TODO add your handling code here:
        btnSearchActionPerformed(evt);
    }//GEN-LAST:event_txtAddressActionPerformed

    private void txtStuNameSearchActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_txtStuNameSearchActionPerformed
        // TODO add your handling code here:
        btnSearchActionPerformed(evt);
    }//GEN-LAST:event_txtStuNameSearchActionPerformed

    private void txtOldPassActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_txtOldPassActionPerformed
        // TODO add your handling code here:
        btnChange1ActionPerformed(evt);
    }//GEN-LAST:event_txtOldPassActionPerformed

    private void txtNewPassActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_txtNewPassActionPerformed
        // TODO add your handling code here:
        btnChange1ActionPerformed(evt);
    }//GEN-LAST:event_txtNewPassActionPerformed

    private void txtRePassActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_txtRePassActionPerformed
        // TODO add your handling code here:
        btnChange1ActionPerformed(evt);
    }//GEN-LAST:event_txtRePassActionPerformed
    public boolean validateInformation() {
        oldPassword = txtOldPass.getText();
        if (oldPassword.equals("")) {
            JOptionPane.showMessageDialog(this, "you must input your old password!");
            txtOldPass.requestFocus();
            return false;
        }
        newPassword = txtNewPass.getText();
        if (newPassword.equals("")) {
            JOptionPane.showMessageDialog(this, "you must input your new password!");
            txtNewPass.requestFocus();
            return false;
        }
        if (newPassword.length() < 6) {
            JOptionPane.showMessageDialog(this, "Password >6 character!");
            txtNewPass.requestFocus();
            return false;
        }
        reNewPassword = txtRePass.getText();
        if (reNewPassword.equals("")) {
            JOptionPane.showMessageDialog(this, "you must input your confirm new passWord!");
            txtRePass.requestFocus();
            return false;
        }
        if (!newPassword.equals(reNewPassword)) {
            JOptionPane.showMessageDialog(this, "Your password do not match ");
            txtRePass.setText("");
            txtRePass.requestFocus();
            return false;
        }
        return true;
    }
    /**
     * @param args the command line arguments
     *
     */
    // Variables declaration - do not modify//GEN-BEGIN:variables
    private javax.swing.JPanel Doctor;
    private javax.swing.JToggleButton btnAddCourse;
    private javax.swing.JToggleButton btnAddPay;
    private javax.swing.JToggleButton btnAddSub;
    private javax.swing.JToggleButton btnAddUser;
    private javax.swing.JToggleButton btnChange1;
    private javax.swing.JButton btnClose;
    private javax.swing.JButton btnClose1;
    private javax.swing.JButton btnClose2;
    private javax.swing.JButton btnClose3;
    private javax.swing.JButton btnClose5;
    private javax.swing.JButton btnClose6;
    private javax.swing.JToggleButton btnDelete;
    private javax.swing.JToggleButton btnDeleteCourse;
    private javax.swing.JToggleButton btnDeletePay;
    private javax.swing.JToggleButton btnDeleteSub;
    private javax.swing.JToggleButton btnDeleteUser;
    private javax.swing.JToggleButton btnDetail;
    private javax.swing.JToggleButton btnEdit;
    private javax.swing.JToggleButton btnEditCourse;
    private javax.swing.JToggleButton btnEditPay;
    private javax.swing.JToggleButton btnEditSub;
    private javax.swing.JToggleButton btnInsert;
    private javax.swing.JButton btnSearch;
    private javax.swing.JButton btnSearchCourse;
    private javax.swing.JButton btnSearchSub;
    private javax.swing.JButton btnSearchUser;
    private creator.components.CheckBoxList cblCourseSearch;
    private javax.swing.JLabel jLabel1;
    private javax.swing.JLabel jLabel10;
    private javax.swing.JLabel jLabel11;
    private javax.swing.JLabel jLabel13;
    private javax.swing.JLabel jLabel16;
    private javax.swing.JLabel jLabel17;
    private javax.swing.JLabel jLabel18;
    private javax.swing.JLabel jLabel19;
    private javax.swing.JLabel jLabel2;
    private javax.swing.JLabel jLabel4;
    private javax.swing.JLabel jLabel7;
    private javax.swing.JLabel jLabel9;
    private javax.swing.JPanel jPanel1;
    private javax.swing.JPanel jPanel10;
    private javax.swing.JPanel jPanel12;
    private javax.swing.JPanel jPanel13;
    private javax.swing.JPanel jPanel14;
    private javax.swing.JPanel jPanel16;
    private javax.swing.JPanel jPanel3;
    private javax.swing.JPanel jPanel4;
    private javax.swing.JPanel jPanel5;
    private javax.swing.JPanel jPanel7;
    private javax.swing.JPanel jPanel8;
    private javax.swing.JPanel jPanel9;
    private javax.swing.JScrollPane jScrollPane1;
    private javax.swing.JScrollPane jScrollPane2;
    private javax.swing.JScrollPane jScrollPane3;
    private javax.swing.JScrollPane jScrollPane5;
    private javax.swing.JScrollPane jScrollPane6;
    private javax.swing.JTabbedPane jTabbedPane1;
    private javax.swing.JLabel lbUserName;
    private javax.swing.JLabel lbUserName1;
    private javax.swing.JTable tbInfo;
    private javax.swing.JTable tbInfoCourse;
    private javax.swing.JTable tbInfoPayment;
    private javax.swing.JTable tbInfoSubject;
    private javax.swing.JTable tbInfoUser;
    private javax.swing.JTextField txtAddress;
    private javax.swing.JTextField txtEmail;
    private javax.swing.JTextField txtFullNameSearch;
    private javax.swing.JPasswordField txtNewPass;
    private javax.swing.JPasswordField txtOldPass;
    private javax.swing.JTextField txtPhone;
    private javax.swing.JPasswordField txtRePass;
    private javax.swing.JTextField txtSearchCourseName;
    private javax.swing.JTextField txtStuNameSearch;
    private javax.swing.JTextField txtValueSearchSub;
    private javax.swing.JTextField txtValueSearh;
    // End of variables declaration//GEN-END:variables
}
